﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DiscoveryLogic.Analytics.UI.Common;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;

namespace DiscoveryLogic.Analytics.Modules.Tools
{
	public class ToolboxModule : IModule
	{
		private readonly IRegionManager regionManager;

		public ToolboxModule(IRegionManager regionMgr)
		{
			this.regionManager = regionMgr;
		}

		#region Implementation of IModule

		public void Initialize()
		{
			IRegion mainRegion = this.regionManager.Regions[VisualStudioLikeRegionNames.ToolboxNaviPane];
			if (mainRegion.Views.Count() == 0)
			{
				Toolbox toolbox = new Toolbox();
				mainRegion.Add(toolbox);
				mainRegion.Activate(toolbox);
			}
		}

		#endregion
	}
}
